local _M = {
    _VERSION = '0.01'
}

_M.get = function()
    -- 取登录用户partyId
    --local partyid = ngx.var.arg_partyid

    local partyid
    local app_stoken = ngx.var.arg_app_stoken          -- ******_partyid
    local session_key = ngx.var.cookie_session_key     -- ******_session_partyid

    if session_key then
        local key = string.match(session_key, "_%d+")
        if key then partyid = string.gsub(key, "_", "") end
    end

    if not partyid and app_stoken then
        local key = string.match(app_stoken, "_%d+")
        if key then partyid = string.gsub(key, "_", "") end
    end

    return partyid
end

return _M
